﻿Imports System.Threading
Imports BUS
Public Class frmBackup : Inherits DevComponents.DotNetBar.Office2007Form

    Private m_strFilePath As String
    Public WriteOnly Property FilePath() As String
        Set(ByVal value As String)
            m_strFilePath = value.Replace("\", "\\")
        End Set
    End Property


    Private m_strFileName As String
    Public Property FileName() As String
        Get
            Return m_strFileName
        End Get
        Set(ByVal value As String)
            m_strFileName = value
        End Set
    End Property



    Public Sub Run()
        If New CBackupRestoreBUS().Backup(m_strFileName, m_strFilePath) Then
            For i As Integer = ProgressBarXProcess.Minimum To ProgressBarXProcess.Maximum
                LabelX1.Text = i & " %"
                ProgressBarXProcess.Value = i
                Thread.Sleep(10)
                Application.DoEvents()
            Next
        Else
            MessageBox.Show("Backup thất bại.", "Thông báo")
        End If
        Me.Close()
    End Sub
End Class